home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dbase / techs.zip / TECH22.ZIP / NUMLOK.ASM < prev    next >
Assembly Source File  |  1985-11-01  |  1KB  |  53 lines

  1. ; Program ...: Numlock.ASM
  2. ; Author ....: Ralph Davis
  3. ; Date ......: September 1, 1985
  4. ; Note ......: Turns the Numlock on or off.  Note that this
  5. ;              listing includes the set of instructions for
  6. ;              turning the Numlock key both on and off.
  7. ;
  8. ;
  9.     .LFCOND            ; List false conditionals.
  10.     PAGE 60,132        ; Page length 60, width 132.
  11.  
  12. COM    EQU     0        ; Assemble as .BIN file
  13. D3    EQU     1        ; for Developer's Release.
  14.         
  15. CODESEG SEGMENT BYTE PUBLIC 'CODE'
  16. NUMLOCK PROC    FAR
  17.     ASSUME CS:CODESEG
  18.     IF    COM
  19.        ORG    100H        ; ORG at 100H for .COM file.
  20.     ENDIF
  21. START:    PUSH    AX        ; Save registers.
  22.     PUSH     DS
  23.     PUSH     SI
  24.      PUSH     CX
  25.     MOV     AX,40H        ; Point DS to system data segment
  26.     MOV     DS,AX
  27.     MOV    SI,17H        ; and SI to KB_FLAG.
  28.     MOV     CX,2        ; Set counter to perform
  29.                 ; loop twice.
  30. LOOPER:    MOV    BL,[SI]        ; Load flag contents
  31.     AND     BL,0DFH     ; and turn off Numlock bit.
  32.                 ; Note that the instruction
  33.                 ; to turn the Numlock key on 
  34.                 ; is  OR BL,20H.
  35.  
  36.     MOV    [SI],BL        ; Replace flag.
  37.     INC    SI        ; Point to KB_FLAG_1
  38.     LOOP    LOOPER        ; and do the same thing.
  39.     POP    CX        ; Restore registers.
  40.     POP    SI
  41.     POP    DS
  42.     POP    AX
  43.     IF    COM        
  44.        INT    20H        ; INT 20H if .COM file.
  45.     ELSE
  46.        RET            ; Far return to dBASE III.
  47.     ENDIF
  48. ;
  49. NUMLOCK    ENDP
  50. CODESEG    ENDS
  51.     END    START
  52.  
  53.